<?php 
## include required files
/*******************************/
require_once '../model/users.php';
require_once '../model/trade.php';
require_once '../model/state.php';
/*******************************/

## Create Objects
/*******************************/
$userObj = new Model_Users();
$tradeObj = new Model_TRADE();
$stateObj = new Model_State();
/*******************************/

## Fetch admin user details by id
if($_GET['id'] != '') {
	$user_id = base64_decode($_GET['id']);	
	$user_details = $userObj->getUserDetailsByUserId($user_id);
	$getalljobtypedetails = $tradeObj->getAllTradesCategoryWithmultipleId($user_details['jobtype']);
	for($k=0;$k<count($getalljobtypedetails);$k++)
	{
		if($getalljobtypedetails[$k]['trade_category']!='')
			$newarry[] = $getalljobtypedetails[$k]['trade_category'];	
	}
	$implode_arr = @implode(", ",$newarry);
	$user_details['jobtypearrray'] = $implode_arr;
	
	$getpostdetail = $stateObj->getPostalDetailsByPostalCode($user_details['workarea']);
	$user_details['suburb'] = $getpostdetail['suburb'];
	$smarty->assign('user_details', $user_details);
}


## Set active class variable for left menu
$smarty->assign('activeclass', 'tradesmanuser');
$smarty->assign('mainmenu', '4');
## Unset all the objects created which are on this page
unset($userObj);

$smarty->display(TEMPLATEDIR_ADMIN. 'tradesmanuser/detailtradesmanuser.tpl');
unset($smarty);
?>